package dataconvert

/**
 * @author: kevin  
 * @date: 11:01 2021/4/30
 */
object Demo2 {
  def main(args: Array[String]): Unit = {

    //强制类型转换
    // int num = (int) 2.4 //java的强制转换
    val num1: Int = 10 * 3.5.toInt + 6 * 1.5.toInt // 36

    val num2: Int = (10 * 3.5 + 6 * 1.5).toInt  //44

    println("num1 = " + num1 + "\n" + "num2 = " + num2)

    val char1 : Char = 1

    val num3 = 1
    //val char2: Char = num3 // error


  }
}
